package cn.blunce.utils.Timer;

import android.os.Handler;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by Blunce on 2015/11/9 0009.
 */
public class MyTimer {
    /**
     * 等待一定的时间去做什么
     *
     * @param handler
     * @param time    要等待的时间
     */
    public static void postDo(final Handler handler, Long time) {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                //handler做什么
                handler.obtainMessage(1).sendToTarget();
            }
        }, time);
    }
}
